import requests from './request'
// 确认订单
export const confirmOrder = (pId, data, totalPrice) => requests({ url: `/order/insertOrder/${pId}?amount=${totalPrice}`, data: data, method: 'post' })

// 支付宝支付
export const pay = (data) => requests({ url: `/alipay/tarde/pay/${data}`, method: 'post' })

// 根据id获取订单
export const getOrderById = (id) => requests({ url: '/order/getOrderById/' + id, method: 'post' })

// 退款
export const refund = (id) => requests({ url: '/order/order/refund/' + id, method: 'get' })

// 删除订单
export const deleteOrder = (id) => requests({ url: '/order/deleteOrder/' + id, method: 'post' })

// 获取今日票房
export const fetchTodayRevenue = () => requests.post('/order/getTodayBoxOffice')
